core: recap contract — pipeline skills run in pre-review, briefing artifacts land in ~/.cockpit/recaps#27
Merged
Conversation
28bb8a1 to
4ebfb7c
Compare
Let the advisory pre-review agent produce a /visual-recap-style briefing
that cockpit can render, gated by diff size / rendered-UI touch.
core:
- config: recaps_dir() + recap_dir_for_pr(&PrRef) (findings slug scheme);
RECAP_MDX_FILE const shared by prompt/ingest/read.
- diff_signals: should_run_review_skills(signals, diff) — true for L/XL or
a diff touching {tsx,jsx,css,scss,vue,svelte,html}; unit-tested.
- prompt: ReviewInput gains pipeline_skills + recap_dir; assemble_review_prompt
appends a Visual Recap section after Output only when both are set. Inactive
output is byte-identical to before (asserted), so review_prompt.txt and
review_prompt_panel.txt are UNCHANGED; added review_prompt_recap.txt for the
active section.
- model: Review.recap_sha (Option<String>, serde default, `string | null`
binding). Deliberately NOT cleared on refresh.
- recap: new module reading recap.mdx + *.excalidraw scenes (sorted, 2 MiB
cap, fail-open) into RecapPayload/RecapScene.
app:
- start_pre_review: create+authorize recap dir, resolve in_review_pipeline
skills (fail-open), compute the gate, pass both into the prompt.
- ingest_review_findings: set recap_sha = current head_sha when a non-empty
recap.mdx exists; recap files are never deleted. refresh preserves recap_sha
(extracted clear_head_anchored_annotations helper, unit-tested).
- get_review_recap command (registered) → RecapPayload.
- regenerated bindings; updated Review fixture.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
10dae8b to
e7d7dd0
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
PR 3/7 of the overnight UX program (Track A backend —
cockpit-docs/OVERNIGHT_UX_PLAN.md). Stacked on #26.recaps_dir()/recap_dir_for_pr(findings-style slug); agent writesrecap.mdx+*.excalidrawscenes there.should_run_review_skillslens gate: diff is L/XL or touches rendered-UI files — exactly the promise the Skills UI copy makes.## Visual Recapsection (after Output, before Project Conventions) instructing the agent to invoke each review-pipeline skill (e.g.visual-recap) and write outputs to the recap dir. Inactive path is byte-identical — both existing goldens untouched, pinned by test; new golden covers the active section.Review.recap_sha: string | null— head sha at generation; ingest sets it whenrecap.mdxis non-empty; refresh preserves it (staleness = sha vs head; Briefing shows a regenerate nudge). Recap files are never auto-deleted.get_review_recapcommand →{ mdx, scenes[], sha }; slug-derived path only, 2 MiB scene cap (symlink-safe + post-read re-check), non-UTF8 skipped, read-only.start_pre_reviewwires it: recap dir pre-created,allow_write_under, pipeline-skill resolution fail-open (§0.1).fs::metadatafor the scene cap + local whitespace-flattening where skill frontmatter enters the prompt.Verified
cargo fmt --check·clippy -D warnings·cargo test(567 across suites) ·tsc·vitest290 ·vite build— all green. Golden regeneration: none of the two existing goldens changed (verified no-op); one new golden added deliberately.🤖 Generated with Claude Code